package cn.kn.sys.dao;

import cn.kn.sys.vo.MenuVo;
import cn.kn.sys.vo.NodeVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author WangJiang
 * @create 2020-12-09 9:12
 */

public interface RecouresDao {

    List<NodeVo> getResources();

    @Select("SELECT r.id FROM sys_role_resources rr JOIN sys_resources r ON (r.id=rr.resources_id) WHERE r.ismenu= FALSE AND rr.role_id =#{roleId}")
    List<Long> getResByRoleId(Long roleId);

    List<MenuVo> getMenu(@Param("userId") Long userId);

    List<String> getPermsByUserId(@Param("userId") Long userId);
}
